<div id="formsuccess" style="display:none">{if isset($errors.status) && $errors.status == "success"}{$href}{/if}</div>
<form name="FormAddParameter" action="?module=backoffice&action=AjaxContext&href={$href}" method="POST" class="nyroModal" >
{t assignTo=title}Add / edit pattern{/t}
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalTitle.html" title=$title}
<div id="modalContent">
	<div id="addParameter">
	  	{if isset($values.docId)}<input type="hidden" name="docId" value="{$values.docId}" />{/if}
	  	<input type="hidden" name="folderId" value="{$folder->getUniqueId()}" />
	  	<input type="hidden" name="folderLang" value="{$folder->getLang()}" />
	    <table class="listTable">
	      <tr>
	        <td><label for="form_label_label">&nbsp;{t}Label{/t} : </label></td>
	        <td><input type="text" id="form_label_label" name="FormAddParameter[label]" value="{if isset($values.label)}{$values.label}{/if}" style="width:300px" /> {if isset($errors.label)}<span>{icon name="warning.png} {$errors.label}</span>{/if}&nbsp;</td>
	      </tr>
	      <tr>
	        <td><label for="form_label_width">&nbsp;{t}Width{/t} ({t}in pixels{/t}) : </label></td>
	        <td><input type="text" id="form_label_width" name="FormAddParameter[width]" value="{if isset($values.width)}{$values.width}{/if}" /> {if isset($errors.width)}<span>{icon name="warning.png} {$errors.width}</span>{/if}</td>
	      </tr>
	      <tr>
	        <td><label for="form_label_height">&nbsp;{t}Height{/t} ({t}in pixels{/t}) : </label></td>
	        <td><input type="text" id="form_label_height" name="FormAddParameter[height]" value="{if isset($values.height)}{$values.height}{/if}" /> {if isset($errors.height)}<span>{icon name="warning.png} {$errors.height}</span>{/if}</td>
	      </tr>
	      <tr>
	        <td><label for="form_label_generateOnUpload">&nbsp;{t}Generate automatically{/t} : </label></td>
	        <td><input id="form_label_generateOnUpload" type="checkbox" name="FormAddParameter[generateOnUpload]" value="true" {if isset($values.generateOnUpload) && $values.generateOnUpload == true}checked="checked"{/if} title="{t}Generate automatically - Downloaded pictures in this folder will be automatically resized to the indicated size (by keeping proportions). All pictures already in this folder won't be affected.{/t}" /></td>
	      </tr>
          <tr id="cropParam">
              <td>&nbsp;{t}Resize mode{/t} :</td>
              <td>
                <select name="FormAddParameter[crop]" id="form_label_crop">
                {foreach from=$values.cropLabel key=i item=label}
                    <option value="{$i}" {if isset($values.crop) && $values.crop == $i}selected{/if} >{$label}</option>
                {/foreach}
                </select>
              </td>
          </tr>
	    </table>
	</div>
</div>
{t assignTo=footerTitle}Save{/t}
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalFooter.html" label=$footerTitle}
</form>

{literal}
<script language="type/javascript">
    $(document).ready(function(){
        checked();
        $(":checkbox").click(checked);
    });

    function checked()
    {
      var n = $("input:checked").length;
      (n == 1) ? $("#cropParam").css("visibility", "visible") : $("#cropParam").css("visibility", "hidden")
    }
</script>
{/literal}